#include <iostream>
using namespace std;


template <class T>
class RAII{
public:
    RAII(T*p)
    :_data(p)
    {

    }
    ~RAII(){
        if(_data){
            delete _data;
            _data=nullptr;
        }
    }
    RAII(const RAII & rhs)=delete;
    RAII& operator=(const RAII & rhs)=delete;
    T* get(){
        return _data;
    }
    T *operator->(){
        return _data;
    }
    T& operator*(){
        return * _data;
    }
private:
    T * _data;
};

class Point{
public:
    Point(int x,int y)
    :_x(x)
    ,_y(y)
    {

    }
    void print(){
        cout<<_x<<_y<<endl;
    }
private:
    int _x,_y;
};
void test(){
    RAII<Point> raii(new Point(1,2));
    raii->print();
}
int main(int argc, char * argv[]){
    
    return 0;
}

